package org.chispa.api.processor;


public class ProcessorFactory {
	
	private static ProcessorFactory instance=new ProcessorFactory();

	private ProcessorFactory(){};
	
	public static ProcessorFactory getInstance(){return instance;}
	
	@SuppressWarnings("unchecked")
	public<R,T> QueryProcessor<R,T> getProcessor(R query,Class<T>returnType){
		if(query.getClass().equals(String.class))
			return (QueryProcessor<R, T>) new SimpleSparqlProc<T>((String )query);
		return null;
	}
	
	public QueryProcessor<String,String> getDefaultProcess(String query){
		return getProcessor(query,String.class);
	}

}
